let r = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
getVid2 = function(e) {
    try {
        let a = Math.random().toString(16).slice(-4);
        if (e <= 4)
            return a.slice(0, e);
        let u = "";
        for (var n = 0; n < e - a.length; n++) {
            var o = Math.ceil(Math.random() * (r.length - 1));
            u += r[o]
        }
        return a + u
    } catch (e) {
        console.error("genRandomStr error.", e)
    }
}

function genVidVal() {
    return "".concat(Date.now(), ".").concat(getVid2(12))
}

var vid = genVidVal();
console.log(vid);